package com.hjw.exer;

/**
 * 商品类，定义了商品信息
 * @author hjwStrart
 * @create 2022-01-07 16:17
 */
public class Commodity {
    private String name;
    private Double price;
    private Double discount;
    private Integer stock;

    public Commodity() {
    }

    public Commodity(String name, Double price, Double discount, Integer stock) {
        this.name = name;
        this.price = price;
        this.discount = discount;
        this.stock = stock;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    @Override
    public String toString() {
        return  "商品名称='" + name + '\'' +
                ", 商品价格=" + price +
                ", 商品折扣=" + discount +
                ", 商品库存=" + stock;
    }
}
